<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<meta name="viewport" content="initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no">
	<title>用户绑定</title>
	<?php include_once 'public/views/header.php'; ?>
	<script src="<?php echo base_url(); ?>public/home/js/jquery.js"></script>
	<script src="<?php echo base_url(); ?>public/home/js/function.js"></script>
	<?php include_once 'public/home/html/alert.php'; ?>
	<?php include_once 'public/home/html/bootstrap.php'; ?>
	
</head>
<body>
<input type="hidden" name="url" value="<?php echo base_url(); ?>" />
<div class="container success-con" style="margin-top: 100px; display: none;">
	<div class="row">
		<div class="col-xs-12 text-center">
			<img src="<?php echo base_url(); ?>public/home/images/right.png" alt=""  style="height:80px; width:80px;"/>
		</div>
		<div class="col-xs-12 text-center" style="font-size:16px; color:#666; margin-top: 10px;">
			您已绑定成功！
		</div>
		<div class="col-xs-12 text-center" style="font-size: 12px; color:#aaa; margin-top: 10px;">
			您现在已经可以操作劳芬加油站了！
		</div>
	</div>
</div>
<div class="container fail-con" style="margin-top: 100px; display: none;">
	<div class="row">
		<div class="col-xs-12 text-center">
			<img src="<?php echo base_url(); ?>public/home/images/error.png" alt=""  style="height:80px; width:80px;"/>
		</div>
		<div class="col-xs-12 text-center" style="font-size:16px; color:#666; margin-top: 10px;">
			对不起，绑定失败！
		</div>
		<div class="col-xs-12 text-center fail-info" style="font-size: 12px; color:#aaa; margin-top: 10px;">
			
		</div>
	</div>
</div>
</body>
	<script>
	var load_alert=loadAlert('绑定中，请稍候...');
		$(function(){
			$('.success-con').hide();
			$('.fail-con').hide();
			setTimeout(function(){
				$.ajax({
					type: "post",
					url: $('input[name="url"]').val()+"Api/ActivationApi/activation",
					data:{
						admin_id:'<?php echo $admin_id; ?>',
						openid:'<?php echo $wx['openid']; ?>',
						wx_name:'<?php echo $wx['nickname']; ?>'
					},
					async: false,
					dataType:'json',
					success: function(ret) {
						// var ret = $.parseJSON(data);
						closeAlert(load_alert);
						if(ret.status) {
							$('.success-con').show();
						} else {
							$('.fail-info').html(ret.msg);
							$('.fail-con').show();
						}
					}
				});
			},1500);
		})
	</script>
</html>